<?php
require_once(dirname(__FILE__)."/../../config/config.php"); 
include 'user.php';

if (isset ($_REQUEST['method'])) {
    if ($_REQUEST['method'] == "showuseridBymacaddress") {
		$result = showuseridBymacaddress($_REQUEST['mac_address']);
		output_result("json", $result);
	}

}

    $sql="SELECT * FROM zy_tvshow  ORDER BY sort ASC";
	$rs = mysql_query($sql);
	$message=array();
	while($row=mysql_fetch_array($rs)){	
		$message[] =array(
			'channellistid'=>$row['tv_id'],
			'description'=>$row['tv_name'],
	        'restriction'=>$row['is_limit']
			
		);
	}
	 echo json_encode($message);

function output_result($type = "json", $result = array ()) {
	if ($type == "json") {
		if (empty ($result)) {
			$message = array (
				"message" => "0001"
			);
		} else {
			$message = $result;
		}
		echo json_encode($message);
		exit ();
	}
}
?>